import re

def parse_points_string(s: str) -> list[tuple[float, float]]:
    """
    解析形如 "[(x1,y1), (x2,y2), (x3,y3)]" 的字符串为元组列表
    
    Args:
        s: 输入字符串，格式为 "[(x1,y1), (x2,y2), (x3,y3)]"
        
    Returns:
        包含3个元组的列表，每个元组包含两个浮点数
        
    Raises:
        ValueError: 如果字符串格式不正确或无法解析
    """
    # 使用正则表达式匹配所有数字
    numbers = re.findall(r'-?\d+\.?\d*', s)
    
    if len(numbers) != 6:
        raise ValueError("字符串中应该包含6个数字")
    
    try:
        # 将字符串转换为浮点数
        numbers = [float(n) for n in numbers]
        
        # 创建三个元组
        points = [
            (numbers[0], numbers[1]),
            (numbers[2], numbers[3]),
            (numbers[4], numbers[5])
        ]
        
        return points
    except ValueError as e:
        raise ValueError(f"无法将字符串转换为数字: {e}")

# 测试用例
test_cases = [
    "[(100,0),(0,0),(-50,100)]",
    "[(1.5,2.5), (3.5,4.5), (5.5,6.5)]",
    "[(-1,-2), (-3,-4), (-5,-6)]",
    "[(1.0,2.0), (3.0,4.0), (5.0,6.0)]"
]

for test in test_cases:
    try:
        result = parse_points_string(test)
        print(f"输入: {test}")
        print(f"输出: {result}")
        print()
    except ValueError as e:
        print(f"输入: {test}")
        print(f"错误: {e}")
        print()